package com.lfy.commons.config.file;

import io.minio.MinioClient;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import javax.annotation.Resource;
/**
 * minio
 *
 * @author <a href="https://www.lvfeiy.top">吕飞扬</a>
 * @date 2023/10/19 21:40
 */
@EnableConfigurationProperties(MinioConfig.class)
@Configuration
public class MinioClientConfig {
    @Resource
    private MinioConfig minioConfig;
    @Bean
    public MinioClient minioClient() {


        return MinioClient.builder()
                .endpoint(minioConfig.getEndpoint())
                .credentials(minioConfig.getAccessKey(), minioConfig.getSecretKey())
                .build();
    }
}